package com.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mapper.auto.StudentMapper;
import com.model.auto.Student;
import com.service.IStudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author astupidcoder
 * @since 2022-09-14
 */
@Service
public class StudentServiceImpl extends ServiceImpl<StudentMapper, Student> implements IStudentService {

    @Autowired
    private StudentMapper studentMapper;

    @Override
    public Student updateStu(Integer id) {
        return studentMapper.updateStu(id);
    }

    @Override
    public Student restoreStu(Integer id) {
        return studentMapper.restoreStu(id);
    }

    @Override
    public void relDeleteStu(Integer id) {
        studentMapper.relDeleteStu(id);
    }

    @Override
    public Long selectIdByUserId(Long userId) {
        return studentMapper.selectIdByUserId(userId);
    }

    @Override
    public Student selectByUserId(Long userId) {
        return studentMapper.selectByUserId(userId);
    }
}
